/* 游戏页面基础样式 */
.game-page {
    background-color: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.game-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

/* 返回按钮 */
.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.back-btn:hover {
    color: var(--primary-color);
    background-color: rgba(108, 92, 231, 0.1);
}

/* 游戏信息 */
.game-info {
    flex: 1;
    text-align: center;
}

.game-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.game-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.stat {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat span {
    color: var(--primary-color);
    font-weight: 700;
}

/* 游戏操作按钮 */
.game-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    color: var(--primary-color);
    background-color: rgba(108, 92, 231, 0.1);
}

/* 游戏主容器 */
.game-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* 游戏区域 */
.game-area {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    position: relative;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 帮助面板 */
.help-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-color);
    width: 320px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
}

.help-panel.active {
    transform: translateX(0);
}

.help-content {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
    position: relative;
}

.help-content h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.control-group {
    margin-bottom: 2rem;
}

.control-group h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.control-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    border-radius: var(--radius-sm);
}

.close-btn:hover {
    color: var(--primary-color);
    background-color: rgba(108, 92, 231, 0.1);
}

/* 游戏消息 */
.game-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(19, 17, 28, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2000;
}

.game-message.active {
    opacity: 1;
    pointer-events: auto;
}

.message-content {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.game-message.active .message-content {
    transform: translateY(0);
}

.message-content h2 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.message-content p {
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary);
}

.final-score {
    color: var(--primary-color);
    font-weight: 700;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--background-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
}

/* 全屏模式 */
.fullscreen {
    background-color: var(--background-color);
}

.fullscreen .game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: transparent;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.fullscreen .game-header:hover {
    opacity: 1;
    background-color: var(--surface-color);
}

.fullscreen .game-container {
    padding: 0;
    height: 100vh;
}

.fullscreen .game-area {
    max-width: none;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-title {
        font-size: 1.25rem;
    }

    .game-stats {
        gap: 1rem;
        font-size: 0.75rem;
    }

    .game-container {
        padding: 1rem;
    }

    .help-panel {
        width: 100%;
    }
}

/* 控制项样式 */
.control-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
}

.control-item .key {
    background-color: var(--surface-color);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    min-width: 2rem;
    text-align: center;
}

.control-item .action {
    color: var(--text-secondary);
    font-size: 0.875rem;
}
